Repository navigation
Conversation
_relayout set flags.calc when a relayout altered the range of an axis in a constraint group. For regl traces, each zoom step then recalculated every trace and uploaded every point again. The replot applies the constraints from the axes. Only an autorange needs the extremes of a new calc. The relayout now sets flags.plot, if every trace is a regl trace and every axis of the group has a fixed range.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A zoom or pan on axes with
scaleanchorno longer recalculatesscattergltraces, if each constrained axis holds a fixed range. With 5 million points, a pan step takes 72 ms, against 908 ms onmain. The change is not opt-in, and the constraint holds as before.Closes #
One pan step by
Plotly.relayoutwithyaxis.scaleanchorand fixed ranges,mainagainst this branch. Median of 10 steps, ten traces, strict bundles, Apple M3 Max, headless Chromium on ANGLE Metal._relayoutsetsflags.calcwhen a relayout alters the range of an axis in a constraint group. For regl traces, each zoom step then recalculates every trace and uploads every point again.The replot applies the constraints from the axes. Only an autorange needs the extremes that a recalc adds. Now the relayout sets
flags.plot, if every trace is a regl trace and every axis of the group has a fixed range. In every other case, the recalc stays.AnnZarro draws embeddings with an equal aspect ratio in plotly.js and needs this. Overview: [combined draft PR link].
Changes
src/plot_api/plot_api.js: new functionconstraintsNeedCalctest/jasmine/tests/plot_api_test.js: 1 new spec for the replot and for the cases that keep the recalctest/jasmine/tests/gl2d_plot_interact_test.js: 1 new spec for the ratio after a zoom, a pan and a relayoutTesting
plot_api: 172 specs pass, andmainhas 171gl2d_plot_interact: 17 specs pass, andmainhas 16cartesianpassesNotes
constrain: 'domain'or several constraint groups yet. I can add them.scaleanchoruploads the same bytes onmain.scatter2d.updatewith the marker options, and regl-scatter2d 3.4.0 then uploads the positions again. The scattergl typed-arrays pull request (link follows) removes this upload.plotly.min.jsgrows by 325 bytesI can reshape or withdraw this pull request. Thank you for your time.
Checklist
ready-for-prlabel, and it has no assignee or lists me as an assigneemainin my forkdist/package-lock.jsononly for a dependency changedraftlogs/as draftlogs/README.md describes, or I will add one after the pull request opens